<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>借阅记录</title>
</head>
<script type="text/javascript">
	
</script>
<body>
	<h2>借阅记录列表</h2>

	请输入读者编号查询:
	<s:form action="/record/Record_recordByReader" method="post">
		<input type="text" name="readerId" />
		<s:submit value="查询" />
	</s:form>

	请输入图书编号查询:
	<s:form action="/record/Record_recordByBook" method="post">
		<input type="text" name="serialnumber" />
		<s:submit value="查询" />
	</s:form>

	<s:form action="/record/Record_recordList" method="post">
		<s:submit value="所有记录" />
	</s:form>
	<table>
		<thead>
			<tr>
				<th>读者编号</th>
				<th>读者姓名</th>
				<th>图书编号</th>
				<th>图书名</th>
				<th>借阅时间</th>
				<th>应归还时间</th>
				<th>是否归还</th>
			</tr>
		</thead>
		<tbody>
			<s:iterator value="list">
				<input type="hidden" id="recordId" name="recordId"
					value="${recordId}" />
				<input type="hidden" id="number" name="number" value="${amount}" />
				<input type="hidden" id="bookId" name="bookId" value="${bookId}" />
				<tr>
					<td><s:property value="readerId" /></td>
					<td><s:property value="readerName" /></td>
					<td><s:property value="bookId" /></td>
					<td><s:property value="bookName" /></td>
					<td><s:property value="createTime1" /></td>
					<td><s:property value="returnTime" /></td>
					<td><c:choose>
							<c:when test="${isReturn ==1}">
								<input type="checkBox" disabled="disabled" />
							</c:when>
							<c:otherwise>
								<input type="checkBox" checked="checked" disabled="disabled" />
							</c:otherwise>
						</c:choose></td>
				</tr>
			</s:iterator>
		</tbody>
	</table>
</body>
<script type="text/javascript">
	function returnBook() {
		confirm('确认归还吗？');
		var recordId1 = document.getElementById("recordId").value;
		var number1 = document.getElementById("number").value;
		var bookId1 = document.getElementById("bookId").value;
		document.operationForm.action = "${basePath}/record/Record_returnBook.action?recordId="${recordId}"&number=number1&bookId=bookId1";
		document.operationForm.submit();
	}
</script>
</html>
